//2009/08/16 17:22:00
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <math.h>
#include <sstream>
#include <algorithm>

using namespace std;

class ComputationalComplexity
{
public:
    int fastestAlgo(vector <int> constant, vector <int> power, vector <int> logPower, int N)
    {
		double mmin = 1 << 30;
		int dxt = -1;
		for(int i=0; i<power.size(); i++)
		{
			double temp = constant[i] * pow(N, power[i]) * pow(log(N), logPower[i]);
			if(mmin > temp || dxt == -1) 
			{
				mmin = temp;
				dxt = i;
			}
		}
		return dxt;
    }
};
